import mitt from 'mitt';

const emitter = mitt()
export const useEventBus = () => {
  return {
    emit: (event, payload) => emitter.emit(event, payload),
    on: (event, callback) => emitter.on(event, callback),
    off: (event, callback) => emitter.off(event, callback)
  }
}

export default useEventBus
